﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Base.Schema;

namespace Base.DataModel
{
    [SchemaElementName("entity")]
    public class Entity : IdentifiedItem
    {
        public Entity(string name, Guid64 id) : base(name, id) 
        {
            _fields = new IdItemCollection<Field>(this);
        }

        public Entity(string name) : this(name, null) 
        { }

        [SchemaPreference("pluralName")]
        public string PluralName { get; set; }

        private IdItemCollection<Field> _fields;

        [SchemaCollection("fields")]
        public IdItemCollection<Field> Fields
        {
            get
            {
                return _fields;
            }
        }
    }
}
